/*
 * comboType="123" selectCode="322"
 * JavaScript - dictionary
 * Version: 0.1
 */
$(function() {
	var coboTypes=${coboTypes};
	$("body").find("select").each(function(){
		var selectElement=$(this);
		var comboType=$(this).attr("comboType");
		var comboValue=$(this).attr("selectCode");
		if(comboType&&""!=comboType){
			var elem="<option value=''>--请选择--</option>";
			$(coboTypes).each(function(){
				var tempType=this.typeNo;
				var dataValues=this.values;
				if(comboType==tempType){
					$(dataValues).each(function(i,the){
						if(comboValue==the.code){
							elem+="<option selected=selected value='"+the.code+"'>"+the.title+"</option>";
						}else{
							elem+="<option value='"+the.code+"'>"+the.title+"</option>";
						}
					});
					$(selectElement).html(elem);
				}
			});
		}
	});
	$("body").find("td").each(function(){
		var element=$(this);
		var comboType=$(this).attr("comboType");
		var comboValue=$(this).html();
		var bool=false;
		if(comboType&&comboValue){
			$(coboTypes).each(function(){
				var tempType=this.typeNo;
				var dataValues=this.values;
				if(comboType==tempType){
					$(dataValues).each(function(i,the){
						var tempValue=this.code;
						var tempTitle=this.title;
						if(comboValue==tempValue){
							bool=true;
							$(element).html(tempTitle);
						}
					});
				}
			});
		}
	});
});
